package com.dbpms.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dbpms.pojo.ClassInfo;
import com.dbpms.pojo.CollegeInfo;
import com.dbpms.pojo.SpecialityInfo;
import com.dbpms.pojo.StudentInfo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.List;

public interface IStudentManageService extends IService<StudentInfo> {
    // 获取学生信息 - 按照学号查询/分页
    public List<StudentInfo> queryStuInfo(String student_number, Page<StudentInfo> page);

    // 获取学生id查询
    public StudentInfo queryOneStuInfo(int stu_id);

    // 获取所有学院信息
    public List<CollegeInfo> queryCollegeInfo();

    // 根据学院获取所属专业
    public List<SpecialityInfo> querySpecialityInfo(int college_id);

    // 根据专业获取所属班级
    public List<ClassInfo> queryClassInfo(int speciality_id);

    // 添加学生信息
    @Transactional
    public String addStudentInfo(StudentInfo studentInfo) ;

    // 删除学生信息
    @Transactional
    public int deleteStudentInfo(int stu_id, int chamber_id,HttpServletRequest req);

    // 修改学生信息
    @Transactional
    public String updateStudentInfo(StudentInfo st, int chamber_id);

    // 修改用户 - 学生信息
    public String updateUserStuInfo(StudentInfo st);

    // 保存图片到指定目录下
    public File saveImg(MultipartFile imageFile, HttpServletRequest req);
}
